'use client'
import './index.scss'
import React, { useEffect, useState } from 'react';
import Siderui from '@/app/components/Siderui/page';
import Documents from '@/app/components/Documents/page';
import keyStore from '@/app/store/key'; 


const DocumentsPage = ({ params }: { params: { id: string } }) => {

    const { datase } = keyStore()
    const [type, settype] = useState('doc')
    /**
     * params.id[0] dify本身的id 
     * params.id[1] RAGflow的id
     */
    useEffect(() => {
        console.log(params.id)
    }, [params.id])

    return (
        <div className='DocumentsPage'>
            <Siderui name={datase.name} description={datase.description} setData={(type) => { settype(type) }} />
            {type == 'doc' && <Documents id={params.id} />} 
            {type == 'ply' && <div>政策查询</div>}
        </div>
    );
};

export default DocumentsPage;